const path = require('path')
const fs = require('fs')
const otr = {}


otr.path = (fils) => {
    let p1 = path.resolve(__dirname, '../', fils.path)
    let p2 = path.resolve(__dirname, '../', fils.path)
    p2 += fils.originalname.substring(fils.originalname.lastIndexOf('.'))
    fs.renameSync(p1, p2)
    let p3 = p2.substring(p2.indexOf('\state') + 5)
    return p3
}

module.exports = otr
